home *** CD-ROM | disk | FTP | other *** search
- WinMac32
-
- Delphi Macro Component and DLL Set for Windows.
-
- Copyright (c) 1994-1997 Ken Henderson.
-
- Here's the 32-bit version of the Winmacro component set and macro engine that
- I originally released for Delphi 1.0. Winmacro 1.x users will remember the
- TMacroSet component -- it implements a full-blown macro engine for Windows.
- The unit actually defines two other components, as well, TMacroKeyEdit (a
- desecendant of TEdit that allows entry of hot keys rather than text) and
- TMacroComboBox (a descendant of TComboBox that allows selection from a list
- of all available keys).
-
- The component set provides much of the functionality of the Windows 3.x Recorder
- accessory, but exceeds it in many ways. One of the most significant
- ways it does this is in its support for "code" macros -- macros that
- execute callback routines rather than playback keystrokes. WinMac32 also
- allows nearly any key on the keyboard to be a hotkey -- it even allows
- mouse buttons to serve in that capacity. And, best of all, it's all
- configurable from a simple component that insulates the developer from
- the complexities, pitfalls and near-death-experiences of the Windows
- journaling facility.
-
- Another set of facilities in which you may have an interest is TMacroSet's SendKeys
- and AppActivate routines. These work similarly to their Visual Basic counterparts.
- AppActivate makes a named window the current input focus, while SendKeys
- sends simulated keyboard input to the current input focus. Note that, unlike
- the 16-bit version of Winmacro, the SendKeys routine in WinMac32 does not require
- that the macro engine be initialized before it can be used. Also, the version
- of SendKeys found in WinMac32 supports a second parameter, "Wait" -- a boolean
- switch that determines whether the routine waits for the current input focus
- to process each simulated keystroke before sending it another.
-
- I won't go into all the features -- the comments in the WinMac32 source code
- document them well. There's also a wealth of info on the internals of the engine
- and components that you may find interesting. If you have the registered version of
- the product, the source to the components are in WMacro.pas, the source to the macro
- engine DLL is in WinMac32.pas.
-
- You'll want to check out the included SRecordR (SuperRecorder) program for a demo
- of some of the things you can do with the macro facility.
-
- I've written the engine in such a way as to make it language independent. I'll
- be releasing the header files required to use it with C/C++ very soon.
-
- Delphi 3 Installation
-
- 1) Unzip WinMac32.zip to the directory in which you'd like it to reside.
- Either add this directory to your path or copy WinMac32.dll to a directory
- that is on your path (e.g., \WINDOWS, \WINDOWS\SYSTEM32, etc.).
-
- **** NOTE: IF YOU NEGLECT TO COPY WINMAC32.DLL TO A DIRECTORY ON YOUR PATH, DELPHI WILL
- BE UNABLE TO LOAD ITS COMPONENT PALETTE THE NEXT TIME IT'S STARTED. PUT WINMAC32.DLL
- ON THE PATH TO REMEDY THIS. ****
-
- 2) Select Install Component from the Delphi 3 Component menu. Click the
- Browse button and locate the WMacro unit file that was created when you
- unzipped WinMac32. Once you return to the Install Component dialog, click OK
- to install the new components.
-
- 3) A new toolbar page called "Macros" is created that contains the three
- components comprising Delphi's interface to WinMac32.dll.
-
- Special note for running SuperRecorder from under Delphi
-
- You'll want to uncheck "Break on exception" in the Tools|Environment Options|Preferences
- dialog when running SuperRecorder under Delphi. SuperRecorder enters a
- loop that iterates through all the *possible* macro indexes and obtains
- the name and hot key for each as it goes. Since macros can be deleted from
- the middle of the macro list -- the engine does not provide a method
- for returning the number of currently allocated macros -- it would be of
- very limited use. Since there is no method of this type available,
- programs wishing to list all available macros must loop through the macro
- list beginning with index 0 through the maximum number of macros. Though
- the maximum number of macros that you may allocate is limited only by available
- memory, TMacroSet surfaces a property, MaxMacroNum, to assist in building macro
- lists. Applications that use MaxMacroNum must handle exceptions generated by
- attempting to access a macro that has been deactivated or by referring to an
- index that has not yet had a macro assigned to it. SuperRecorder demonstrates
- how to do this.
-
- Limits on use
-
- This version of Winmacro has been released as a Shareware product. WinMac32
- comes in two flavors: the trial version and the full version. The trial version will
- only run when Delphi is also running. If you attempt to run an application that uses
- the demo version of TMacroSet or WinMac32 while Delphi 3 is not also running, the DLL
- will refuse to load and your application will crash.
-
- The full version, on the other hand, functions properly regardless of whether
- Delphi is running. It also includes the complete source code to WinMac32,
- as well as the 16-bit version of the product for use with Delphi 1.0.
-
- You can obtain the full version by registering. Since the trial version of the product
- is for trying it out only, you can't include it with other applications. You must
- register the product if you intend to use it. You can register via mail or via
- the Compuserve SWREG forum. To register via the mail, send a check or money order
- for $45 + $5 shipping/handling (in US dollars) to:
-
- Ken Henderson
- P. O. Box 720844
- Norman, OK 73070
-
- To register via Compuserve, GO SWREG and select Register Shareware from the menu.
- The registration ID for WinMac32 is 16253. Once I receive your registration notification,
- I'll send you the complete WinMac32 package via CIS.
-
- Once registered, you'll receive:
-
- * the complete source code to WinMac32
- * the source code to SendKeys and AppActivate, which can be used independently of the
- macro engine
- * the full, non-crippled version of the product
- * the 16-bit version of the product for use with Delphi 1.0
- * notification of future updates and upgrades
-
- Note that the source code to SendKeys and AppActivate also accompanies several of my books,
- available from SAMS Publishing. Currently, those books are: Database Developer's Guide with
- Delphi 2.0, Teach Yourself IntraBuilder in 21 Days, Teach Yourself C++Builder in 21 Days,
- Client/Server Developer's Guide with Delphi 3 and Client/Server Developer's Guide with
- C++Builder.
-
- You can include the full version of WinMac32 with the applications you write without
- royalties or other obigations to me. The only restriction on this is that you may not
- include WinMac32 with a programming library of any type without my express written permission.
-
- You can feel free to upload the trial version of WinMac32 to other on-line forums and
- ftp sites so long as you do not modify it in any way (this includes adding or removing
- files from its ZIP file archive).
-
- I'd appreciate any feedback you might have. Send any comments or
- suggestions to (CIS): 74763,2305 (Internet: khen@compuserve.com).
-
- Ken Henderson
- October 24, 1997
-
-
-